<template>
    <div class="qingwu">
        <div class="unline underm"></div>
        <div class="admin_form">
            <a-form-model :label-col="{ span: 5 }" :wrapper-col="{ span: 12 }">
                <a-form-model-item label="水表名称">{{info.name}}</a-form-model-item>
                <a-form-model-item label="水表编码">{{info.code}}</a-form-model-item>
                <a-form-model-item label="初始表码" >{{info.number}}</a-form-model-item>
                <a-form-model-item label="所属采集器" >{{collect.name}}</a-form-model-item>
                <a-form-model-item label="收费方案" >{{plan.plan_title}}</a-form-model-item>
                <a-form-model-item label="报警方案" >{{alarm.plan_title}}</a-form-model-item>
<!--                <a-form-model-item label="电表品牌" >{{info.brand}}</a-form-model-item>
                <a-form-model-item label="父级电表表码" >{{parent.code}}</a-form-model-item>-->

            </a-form-model>


        </div>
    </div>
</template>

<script>
    export default {
        props:['params'],
        data(){
            return {
                info:{
                    name:''
                },
                collect:{
                    id:'',
                    name:''
                },
                plan:{
                    id:'',
                    plan_title:''
                },
                alarm:{
                    id:'',
                    plan_title:''
                },
            }
        },
        methods:{
            get_info(){
                this.$get(this.$api.waterDetail+'/'+this.params.id).then(res=>{
                    console.log(res)
                    let data = res.data;
                    this.info = data;
                    if(data.one_collector){
                        this.collect = data.one_collector;
                    }
                    if(data.one_plan){
                        this.plan = data.one_plan;
                    }
                    if(data.one_alarm){
                        this.alarm = data.one_alarm;
                    }
                    this.$forceUpdate();
                })
            },
            onload(){
                this.get_info();
            },
        },
        created() {
            this.onload();
        },
    }
</script>
